<?php
session_start();

if ($_POST['descAgenda'] != NULL && $_POST['dateAgenda'] != NULL) {
    $date = $_POST['dateAgenda'];
    $place = $_POST['placeAgenda'];
    $desc = $_POST['descAgenda'];
    $sTimeAgenda = $_POST['sTimeAgenda'];
    $eTimeAgenda = $_POST['eTimeAgenda'];



    include 'DBLibrary/config.php';
    include 'DBLibrary/openDB.php';

    mysql_select_db("rotaract");
    $query = "INSERT INTO `rotaract`.`agenda` (`date`, `place`, `desc`, `sTimeAgenda`, `eTimeAgenda`) VALUES('$date','$place','$desc','$sTimeAgenda','$eTimeAgenda');";
    $result = mysql_query($query);

    if ($result == true) {
        ?>
        Agenda addition successful!
        <?
    }
} else {
    ?>
    Incomplete or Null fields. Please click <a href="Welcome.php" target="content">here</a> to go back.
    <?
}


mysql_close($conn);
?>

